<?php
namespace Zhu\Controller;
use Think\Controller;
class AdminController extends Controller {
    public function index(){
       $this->display(); 
    } 
    public function af_sc(){
    	     $data["banner"]=i('banner');
    	     $index=D('index');
    	     $id['id']=array('eq',1);
    	     $banner=$data["banner"];
    	         $id_p['banner']=array('exp',"'$banner'");
    	     $index->where($id)->save($id_p);//按条件修改数据  
    }
    	public function up_po(){
		    $upload = new \Think\Upload();// 实例化上传类
   			$upload->maxSize   =     0 ;// 设置附件上传大小
    	    $upload->exts      =     array('jpg', 'gif', 'png', 'jpeg','mp4','rmvb');// 设置附件上传类型
   		    $upload->rootPath  =     './Upload'; // 设置附件上传根目录
   		    $upload->savePath  =     '/img'; // 设置附件上传（子）目录
    		// 上传文件 
    		$info   =   $upload->upload(); 
   			 if(!$info) {// 上传错误提示错误信息
      			  $this->error($upload->getError());
  			  }else{// 上传成功 
  			 	 foreach($info as $file){
  			 	    $po_i="http://172.16.2.104/case/Upload";
  			 	 	$dokj["img"]=$po_i.=$file['savepath'].$file['savename'];
  			 	 	 $this->ajaxReturn($dokj);
   				 }
   			 }
	}
}